﻿using System;

namespace BSharp.Compiler
{
	public enum UnaryOperation {
		Reference,
		Derefence,
		Negate,
		BitwiseNot,
		Not
	}

	public class UnaryExpression : AstNode
	{
		public readonly UnaryOperation Operation;

		public readonly AstNode Value;

		public UnaryExpression (SourceLocation location, UnaryOperation operation, AstNode value)
			: base (location)
		{
			Operation = operation;
			Value = value;
		}

		public override void Visit (AstVisitor visitor)
		{
			visitor.Accept (this);
		}

		public override void VisitChildren (AstVisitor visitor)
		{
			Value.VisitChildren (visitor);
		}
	}
}

